import request from '@renderer/utils/http'
import { BaseResult, PageResult } from '@renderer/types/axios'
import { UserInfo, UserQuery } from './types'

export class UserService {
  /**
   * 登录成功后获取用户信息（昵称、头像、权限集合和角色集合）
   */
  static getUserInfo() {
    return request.get<BaseResult<UserInfo>>({
      url: '/api/v1/admin/users/me'
    })
  }

  static getUserList(data: UserQuery) {
    return request.get<PageResult<UserInfo>>({
      url: '/api/v1/admin/users/page',
      params: data
    })
  }
}
